fn main() {
    println!("Hello, world!");

    let s = String::from("broadcast");

    let part1 = &s[0..5];
    let part2 = &s[5..9];

    println!("{}={}+{}", s, part1, part2);


  let hello=  String::from("hello");
  let sellohello=  &hello[..2];
    println!("Hello, sellohello {}",sellohello);

    let sellohello3=  &hello[3..];
    println!("Hello, sellohello3 {}",sellohello3);


//    -----------------------------------------------------------------------------------
    let rect1 = (30, 50);
    println!(
        "The area of the rectangle is {} square pixels.",
        area(rect1)
    );


//    --------------------------------------------

    let rect1 = Rectangle { width: 30, height: 50 };

    println!(
        "The area of the rectangle is {} square pixels.",
        a(&rect1)
    );
}


fn area(dies :(u32,u32))->u32{
    dies.0 * dies.1
}
fn a(rectangle: &Rectangle) -> u32 {
    rectangle.width * rectangle.height
}
#[derive(Debug)]
struct Rectangle {
    width: u32,
    height: u32,
}